package com.lenovo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Repository;

import com.lenovo.dao.BaseDAO;
import com.lenovo.model.GBaiduInfo;
import com.lenovo.model.GCrawlerSystem;
import com.lenovo.service.BaiduInfoService;

@Repository
public class BaiduInfoServiceImpl implements BaiduInfoService{

	@Resource
	private BaseDAO dao;
	
	@Override
	public boolean save(GBaiduInfo obj) {
		// TODO Auto-generated method stub
		boolean status = false;
		try{
			dao.save(obj);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

	@Override
	public boolean del(String id) {
		// TODO Auto-generated method stub
		boolean status = false;
		try{
			dao.delById(GBaiduInfo.class, id);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

	@Override
	public boolean update(GBaiduInfo obj) {
		// TODO Auto-generated method stub
		boolean status = false;
		try{
			dao.update(obj);
			status = true;
		}catch(Exception ex){
			ex.printStackTrace();
		}	
		return status;
	}

	@Override
	public List<GBaiduInfo> browse(int pageNo,int pageSize) {
		// TODO Auto-generated method stub
		return dao.listAll("GBaiduInfo",pageNo,pageSize) ;
	}

	@Override
	public GBaiduInfo load(String id) {
		// TODO Auto-generated method stub
		return (GBaiduInfo) dao.loadById(GBaiduInfo.class, id);
	}

	@Override
	public List<GBaiduInfo> browse() {
		// TODO Auto-generated method stub
		return dao.listAll("GBaiduInfo");
	}

}
